﻿<%@ page language="java" import="java.util.*,cn.ac.cintcm.dataconverge.researcher.domain.*,cn.ac.cintcm.dataconverge.util.*" pageEncoding="UTF-8"%>
<%@ page import="cn.ac.cintcm.dataconverge.researchsubject.domain.*,com.hs.core.db.*,java.util.*,com.hs.core.page.PageUtil,com.hs.core.utils.*" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String uid = request.getParameter("uid");
String sql = "select * from RESMAN_RESEARCHER where ids=?";
DBOperator dbo = new DBOperator(request.getSession().getServletContext()); 
System.out.println("sql::::" + sql);
List list = dbo.select(sql,new Object[]{uid});
Map m = new HashMap();
if(list.size()>0){
	m = (Map)list.get(0);
}

String imagePath = path + "/index/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title><%=Constants.APP_TITLE%>-用户名修改</title> 
    <script language="javascript" type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
	<script language="javascript" src="<%=path %>/index/Scripts/script.js"></script>
	  <script src="<%=basePath%>js/common.js" language="javascript" type="text/javascript"></script>
       <script src='<%=basePath%>dwr/engine.js'></script>
     <script src='<%=basePath%>dwr/util.js'></script> 
     <script src='<%=basePath%>dwr/interface/subject.js'></script>
	 <link href="<%=path %>/index/Themes/com/style.css" type="text/css" rel="stylesheet"></link>
	 <script language="javascript">
	  function updateUser(){
	     var loginId = form1.userName.value;
	     var oldId = '<%=m.get("ID") %>';
	     if('' == loginId){
	     	alert('请输入新的用户帐号');
	     	return
	     }
	     if(loginId == oldId){
	     	alert('新的用户帐号与原帐号相同');
	     	return
	     } 
	     subject.updateUserLoginId(loginId,<%=uid%>,callBackUpdate); 
	      
	  } 
	  function callBackUpdate(message){
	    alert('修改成功');
	    window.close();
	   	window.opener.document.pageForm.submit();
	  }
	 </script>
	 
</head>
<body class="idt_body" scroll="yes">
<form name="form1" action="" method="post" >
    <table cellpadding="0" cellspacing="0" width="100%" height="100%" id="Table8">
        <tr>
            <td valign="top" height="100%">
                <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" id="Table11">
                    <tr>
                        <td class="idt_main_m">
                            <!------------------ 标题栏 ------------------>
                            <!--- 标题 ---->
                            <table class="idt_tle_mg" cellspacing="0" cellpadding="0" width="100%">
                                <tr  >
                                    <td class="idt_tle_i">
                                        <img id="imgForm6" src="<%=imagePath %>Themes/com/idt_tle_o.gif"></td>
                                    <td class="idt_tle_f1">
                                        修改用户名</td>
                                </tr>
                            </table>
                            <!--- 内容 --->
                            <div id="tdForm">
                                <table border="0" cellpadding="0" cellspacing="1" width="100%" class="com_fieldset_tab">
                                    
                                    <tr>
                                        <td class="fim_l">
                                            原用户名：
                                        </td>
                                        <td class="fim_r"   style="width:100%">
                                             <strong><%=m.get("ID") %></strong>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td class="fim_l">
                                            用户姓名：
                                        </td>
                                        <td class="fim_r"   style="width:100%">
                                             <strong><%=m.get("NAME") %></strong>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td class="fim_l"> 
                                           新用户名：
                                        </td>
                                        <td class="fim_r"   style="width:100%">
                                            <input type="text" name="userName" class="com_textbox" value=""/>
                                        </td>                           
                                    </tr> 
                                </table> 
                                  <table cellspacing="0" cellpadding="0" width="100%" class="idt_bottom_mg" border="0">
                                    <tr>
                                        <td align="right">
                                            <input type="button" value="保存"  class="com_btn2"   onclick="javascript:updateUser();"/>
                                            <input type="button" value="取消"   class="com_btn2" id="Button2" onclick="javascript:window.close();"/>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                </table> 
       </td>
       </tr>
       </table>
       </form>
                
</body>
</html> 
